package com.wangcanxuan.www.util.constant;

import com.wangcanxuan.www.util.PropertiesReaderUtil;

/**
 * 数据库连接池常数
 *
 * @author HHLJ
 * @date 2022/03/22
 */
public class PooledConstants {
    static {
        PropertiesReaderUtil.getInstance("db.properties");
    }
    /**
     * 数据库url
     */
    public static final String URL = PropertiesReaderUtil.getProperty("URL");
    /**
     * 数据库用户名
     */
    public static final String USER_NAME = PropertiesReaderUtil.getProperty("USER_NAME");
    /**
     * 数据库密码
     */
    public static final String PASSWORD = PropertiesReaderUtil.getProperty("PASSWORD");
    /**
     * 注册驱动
     */
    public static final String DRIVER = PropertiesReaderUtil.getProperty("DRIVER");
    /**
     * 初始化连接数
     */
    public static final Integer INIT_CONNECTIONS = Integer.valueOf(PropertiesReaderUtil.getProperty("INIT_CONNECTIONS"));
    /**
     * 从连接池中获取一个连接最大等待多少时间或等待连接进行完任务
     */
    public static final Integer TIME_TO_WAIT = Integer.valueOf(PropertiesReaderUtil.getProperty("TIME_TO_WAIT"));
    /**
     * 超时时间
     */
    public static final Integer MAX_CONNECTION_TIME = Integer.valueOf(PropertiesReaderUtil.getProperty("MAX_CONNECTION_TIME"));
    /**
     * 测试表
     */
    public static final String TEST_TABLE = PropertiesReaderUtil.getProperty("TEST_TABLE");
    /**
     * 测试连接时间
     */
    public static final Integer TEST_CONNECTIONS_TIME = Integer.valueOf(PropertiesReaderUtil.getProperty("TEST_CONNECTIONS_TIME"));
    /**
     * 最大连接数
     */
    public static final Integer MAX_CONNECTIONS = Integer.valueOf(PropertiesReaderUtil.getProperty("MAX_CONNECTIONS"));
    /**
     * 最大平时连接数
     */
    public static final Integer MAX_USUAL_CONNECTIONS = Integer.valueOf(PropertiesReaderUtil.getProperty("MAX_USUAL_CONNECTIONS"));
    /**
     * 连接阻塞队列的大小
     */
    public static final Integer CONNECTIONS_BLOCKING_QUEUE_SIZE = Integer.valueOf(PropertiesReaderUtil.getProperty("CONNECTIONS_BLOCKING_QUEUE_SIZE"));
    /**
     * 队列超时
     */
    public static final Integer QUEUE_TIME_OUT = Integer.valueOf(PropertiesReaderUtil.getProperty("QUEUE_TIME_OUT"));
}
